package com.yjz.study.http.api

import com.yjz.common.restful.JCall
import com.yjz.common.restful.annotation.Filed
import com.yjz.common.restful.annotation.GET
import com.yjz.common.restful.annotation.POST
import com.yjz.common.restful.annotation.Path
import com.yjz.study.http.entity.res.Favorite
import com.yjz.study.http.entity.res.GoodsDetailModel
import com.yjz.study.http.entity.res.GoodsList

/**
 *作用 : 商品相关
 *作者 : yjz
 *时间 : 2025/3/14 10:03
 */
interface GoodsApi {

    /**
     * 获取分类商品数据
     */
    @GET("goods/goods/{categoryId}")
    fun queryCategoryGoodsList(
        @Path("categoryId") categoryId: String,
        @Filed("subcategoryId") subcategoryId: String,
        @Filed("pageSize") pageSize: Int,
        @Filed("pageIndex") pageIndex: Int
    ): JCall<GoodsList>

    /**
     * 获取商品详情
     */
    @GET("goods/detail/{id}")
    fun queryDetail(@Path("id") goodsId:String):JCall<GoodsDetailModel>

    /**
     * 收藏和取消收藏
     */
    @POST("favorites/{goodsId}")
    fun favorite(@Path("goodsId") goodsId: String): JCall<Favorite>
}